package com.example.app2024.note;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.example.app2024.R;

public class RecordActivity extends AppCompatActivity
{

      @Override
      protected void onCreate(Bundle savedInstanceState)
      {
            super.onCreate(savedInstanceState);
            EdgeToEdge.enable(this);
            setContentView(R.layout.activity_record);
            ViewCompat.setOnApplyWindowInsetsListener(
                    findViewById(R.id.main), (v, insets) -> {
                          Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
                          v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
                          return insets;
                    });
      }

      public void onClick(View view)
      {
            int id = view.getId();
            if (id == R.id.iv_back)
            {
                  finish();

            }else if (id == R.id.iv_delete)
            {
                  EditText editText = findViewById(R.id.et_record);
                  editText.setText("");
            }
            else if (id == R.id.iv_save)
            {
                  //TODO  保存数据
                  finish();

            }

      }
}